<?php
include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/model/repairHistory.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/smartrfid/dto/repairHistorydto.php');
error_reporting(0);

$limit = $_GET['limit'];
$skip = $_GET['skip'];
$orderBy = $_GET['orderBy'];
$filters = $_GET['filters'];
$rfid = $_GET['rfids'];
$identifier = $_GET['identifiers'];
$itemId = $_GET['itemId'];

$t=new RepairHistory();

if($rfid) {
  $histories = $t->loadByRfid($rfid);
} else if($itemId) {
  $histories = $t->loadByItemId($itemId);
}

$list=array();
foreach($histories as $history) {
  array_push($list, new RepairHistorydto($history));
}
echo json_encode($list);



?>
